<!DOCTYPE html>
<html lang="en" layout:decorator="common/contentLayout"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">

<!--页面内容 继承自common/contentLayout.html-->
<div layout:fragment="content">

    <form class="layui-form" id="queryForm">
        <div class="layui-form-item layui-inline">

            <div class="layui-inline">
                <label class="layui-form-label">消息主题：</label>

                <div class="layui-input-block" style="width: 300px">
                    <select lay-ignore id="topicName" name="name" required lay-verType="topicName" lay-verify="required" class="layui-input">
                    </select>
                </div>
            </div>

            <div class="layui-inline">
                <div class="layui-input-inline" style="width: 150px">
                    <select id="topicExceptionType" class="search-select">
                        <option value="">请选topic异常类型</option>
                        <option value ="1">僵尸topic</option>
                        <option value ="2">负责人异常</option>
                        <option value ="3">无人订阅的topic</option>
                    </select>
                </div>
            </div>

            <div class="layui-inline">
                <div class="layui-input-inline" style="width: 150px">
                    <select id="queueManagementType" class="search-select">
                        <option value="">请选队列治理类型</option>
                        <option value ="1">应该缩容</option>
                        <option value ="2">应该扩容</option>
                    </select>
                </div>
            </div>

            <a class="layui-btn" id="topicSearchList_btn" lay-filter="topicSearchFilter"><i class="layui-icon">&#xe615;</i>查询</a>
        </div>
    </form>

    <table id="topicReportTable" class="layui-table" lay-data="{height:'full', page:true,limits:[10,20,30,40,50,60,70,80,90,100,1000,2000],limit: 10, id:'topicReportTable',toolbar:'#toolbarDemo'}" lay-filter="topicReportTable">
        <thead>
        <tr>
            <th lay-data="{field: 'id', align: 'center', sort: true, templet: '#idTpl',width:'6%'}">ID</th>
            <th lay-data="{field: 'name', align: 'center',sort: true}">topic名称</th>
            <th lay-data="{field: 'queueCount',align: 'center',width:'6%'}">队列数量</th>
            <th lay-data="{field: 'saveDayNum',align: 'center',width:'6%'}">保留天数</th>
            <th lay-data="{field: 'ownerNames', align: 'center',sort: true,width:'10%'}">负责人</th>
            <th lay-data="{field: 'msgCount', align: 'center',sort: true}">消息总量</th>
            <th lay-data="{field: 'avgCount', align: 'center',sort: true}">实际每日消息量</th>
            <th lay-data="{field: 'avgCountOfQueue', align: 'center',sort: true}">每个队列平均每日消息量</th>
            <th lay-data="{field: 'isReasonable', align: 'center',sort: true,width:'8%'}">队列治理</th>
            <th lay-data="{field: 'manageQueueCount', align: 'center',sort: true}">队列数量治理</th>
            <th lay-data="{fixed: 'right', align:'center',toolbar: '#ctrlBar'}">操作区</th>
        </tr>
        </thead>
    </table>

</div>

<div layout:fragment="end-load-files">
    <script th:src="@{/js/topicReport.js}"></script>

    <script type="text/html" id="ctrlBar">
        {{# if (d.manageQueueCount <0) { }}
        <a class="layui-btn layui-btn-xs" lay-event="reduce"><i class="layui-icon">&#xe61a;</i>缩容</a>
        {{# } else if (d.manageQueueCount >0) { }}
        <a class="layui-btn layui-btn-xs" lay-event="expand"><i class="layui-icon">&#xe619;</i>扩容</a>
        {{# } else{ }}

        {{# } }}


    </script>
</div>
</html>
